﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Calc.WebForm.aspx.cs" Inherits="Calc.Web.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
   
<head runat="server">
    <title></title>
    <style type="text/css">
        #form1
        {
            width: 285px;
        }
        #Button22
        {
            height: 50px;
            width: 50px;
        }
    </style>

</head>
<body style="width: 887px">
     <script language="javascript" type="text/javascript">
         function AddOne() {
             var br1 = document.getElementById("FgC");
             var br2 = document.getElementById("TextBox1");
             if (br1.Value == "") {
                 br2.Value = "";
                 br2.Value = br2.Value + "1";
                 br1.Value = "false";
             }
             else if (br1.Value == "false") {
                 br2.Value = br2.Value + "1";
             }
         }
             </script>
     <script language="javascript" type="text/javascript">
         function AddTwo() {
             var br1 = document.getElementById("FgC");
             var br2 = document.getElementById("TextBox1");
             if (br1.Value == "") {
                 br2.Value = "";
                 br2.Value = br2.Value + "2";
                 br1.Value = "false";
             }
             else if (br1.Value == "false") {
                 br2.Value = br2.Value + "2";
             }
         }
             </script>
    <script language="javascript" type="text/javascript">
        function AddThree() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            if (br1.Value == "") {
                br2.Value = "";
                br2.Value = br2.Value + "3";
                br1.Value = "false";
            }
            else if (br1.Value == "false") {
                br2.Value = br2.Value + "3";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddFour() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            if (br1.Value == "") {
                br2.Value = "";
                br2.Value = br2.Value + "4";
                br1.Value = "false";
            }
            else if (br1.Value == "false") {
                br2.Value = br2.Value + "4";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddFive() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            if (br1.Value == "") {
                br2.Value = "";
                br2.Value = br2.Value + "5";
                br1.Value = "false";
            }
            else if (br1.Value == "false") {
                br2.Value = br2.Value + "5";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddSix() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            if (br1.Value == "") {
                br2.Value = "";
                br2.Value = br2.Value + "6";
                br1.Value = "false";
            }
            else if (br1.Value == "false") {
                br2.Value = br2.Value + "6";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddSeven() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            if (br1.Value == "") {
                br2.Value = "";
                br2.Value = br2.Value + "7";
                br1.Value = "false";
            }
            else if (br1.Value == "false") {
                br2.Value = br2.Value + "7";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddEight() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            if (br1.Value == "") {
                br2.Value = "";
                br2.Value = br2.Value + "8";
                br1.Value = "false";
            }
            else if (br1.Value == "false") {
                br2.Value = br2.Value + "8";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddNine() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            if (br1.Value == "") {
                br2.Value = "";
                br2.Value = br2.Value + "9";
                br1.Value = "false";
            }
            else if (br1.Value == "false") {
                br2.Value = br2.Value + "9";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddZero() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            var br3 = document.getElementById("FgZero");
            if (br1.Value == "" && br3.Value == "") {
                br2.value = "";
                br2.value = br2.Value + "0";
                br1.Value = "false";
                br3.Value = "false";
            }
            else if (br1.Value == "false" && br3.Value == "") {
                br2.value = br2.Value + "0";
                br3.Value = "false";
            }
            else if (br2.value != "" && br1.Value == "") {
                br2.value = br2.Value + "0";
            }
            else if (br2.value != "" && br2.value != "0") {
                br2.value = br2.Value + "0";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function AddZap() {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            var br3 = document.getElementById("FgZap");
            
            if (br2.value != "" && br3.Value == "") {
                br2.value = br2.Value + "0,";
                br3.Value = "false";
                br1.Value = "false";
            }
            else if (br2.value != "" && br3.Value == "") {
                br2.value = br2.Value + ",";
                br3.Value = "false";
            }
            else if (br2.Value  == "" && br3.Value == "") {
                br2.value = br2.Value + "0,";
                br3.Value = "false";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function Clear() 
        {
            var br1 = document.getElementById("FgC");
            var br2 = document.getElementById("TextBox1");
            var br3 = document.getElementById("FgZap");
            br2.value = "0";
            br1.Value = "";
            br3.Value = "";
        }
    </script>
     <script language="javascript" type="text/javascript">
         function ClearAll() {
             var br1 = document.getElementById("FgC");
             var br2 = document.getElementById("TextBox1");
             var br3 = document.getElementById("FgZap");
             var br5 = document.getElementById("Num1");
             var br6 = document.getElementById("Num2");
             br2.value = "0";
             br1.Value = "";
             br3.Value = "";
             br5.value = "0";
             br6.Value = "0";
         }
     </script>
       <script language="javascript" type="text/javascript">

           function AddOne() {
               var br1 = document.getElementById("FgC");
               var br2 = document.getElementById("TextBox1");

               if (br1.Value == "true") {
                   br2.Value = "";
                   br2.Value = "1";
                   br1.Value = "false";
               }
               else if (br1.Value == "false") {
                   br2.Value = "1";
               }
           }
         </script>
    
    <form id="form1" runat="server" 
    style="background-image: url('008108(Матрица,код,matrix).jpg'); height: 446px;">
       <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
       <asp:UpdatePanel runat="server" ID="ResultPanel">
        <ContentTemplate>
    <div style="width: 324px">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

        <asp:TextBox ID="TextBox1" runat="server" Font-Size="XX-Large" Height="48px" 
            Width="235px" AutoPostBack="True" ReadOnly="True"></asp:TextBox>
        <br />
                
        <br />

    </div>
     
    <div>
         
   <div style="height: 47px; width: 325px">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" Font-Size="X-Large" Height="37px" 
            Text="CE" Width="111px" onclick="ButtonClearAll" OnClientClick="ClearAll()"/>
&nbsp;&nbsp;
        <asp:Button ID="Button2" runat="server" Font-Size="X-Large" Height="38px" 
            Text="C" Width="114px" onclick="ButtonClear" OnClientClick="Clear()"/>
    </div>
     <div style="height: 41px; width: 325px">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button3" runat="server" Font-Size="X-Large" Height="34px" 
             Text="+/-" Width="74px" onclick="SubAdd"/>
&nbsp;
         <asp:Button ID="Button4" runat="server" Font-Size="X-Large" Height="35px" 
             style="margin-left: 1px" Text="Sqrt" Width="75px" onclick="ButtonKoren"/>
&nbsp;&nbsp;
         <asp:Button ID="Button5" runat="server" Font-Size="X-Large" Height="34px" 
             Text="1/x" Width="67px" onclick="ButtonDelenie1"/>
    </div>
     <div style="height: 58px; width: 324px">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button6" runat="server" Font-Size="X-Large" Height="50px" 
             Text="7" Width="50px" onclick="ButtonAddSeven" OnClientClick="AddSeven()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button7" runat="server" Font-Size="X-Large" Height="50px" 
             Text="8" Width="50px" onclick="ButtonAddEight" OnClientClick="AddEight()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button8" runat="server" Font-Size="X-Large" Height="50px" 
             Text="9" Width="50px" onclick="ButtonAddNine" OnClientClick="AddNine()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button9" runat="server" Font-Size="X-Large" Height="50px" 
             Text="/" Width="50px" onclick="ButtonDelenie"/>
    </div>
     <div style="height: 56px; width: 323px">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button10" runat="server" Font-Size="X-Large" Height="50px" 
             Text="4" Width="50px" onclick="ButtonAddFour" OnClientClick="AddFour()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button11" runat="server" Font-Size="X-Large" Height="50px" 
             Text="5" Width="50px" onclick="ButtonAddFive" OnClientClick="AddFive()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button12" runat="server" Font-Size="X-Large" Height="50px" 
             Text="6" Width="50px" onclick="ButtonAddSix" OnClientClick="AddSix()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button13" runat="server" Font-Size="X-Large" Height="50px" 
             Text="*" Width="50px" onclick="ButtonYmnog"/>
    &nbsp;</div>
     <div style="height: 58px; width: 322px">
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         
       
         <asp:Button ID="Button23" runat="server" Font-Size="X-Large" Height="50px" 
             Text="1" Width="50px" OnClientClick="AddOne()" OnClick="ButtonAddOne"/>
             
         &nbsp; &nbsp;<asp:Button ID="Button15" runat="server" Font-Size="X-Large" Height="50px" 
             Text="2" Width="50px"  OnClientClick="AddTwo()" OnClick="ButtonAddTwo"/>
&nbsp;&nbsp;
         <asp:Button ID="Button16" runat="server" Font-Size="X-Large" Height="50px" 
             Text="3" Width="50px" OnClientClick="AddThree()" onclick="ButtonAddThree" />
&nbsp;&nbsp;
         <asp:Button ID="Button17" runat="server" Font-Size="X-Large" Height="50px" 
             Text="-" Width="50px" onclick="ButtonMinus" />
    </div>
     <div style="width: 319px">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button18" runat="server" Font-Size="X-Large" Height="50px" 
             Text="0" Width="50px" onclick="ButtonAddZero" OnClientClick="AddZero()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button19" runat="server" Font-Size="X-Large" Height="50px" 
             Text="," Width="50px" onclick="ButtonAddZap" OnClientClick="AddZap()"/>
&nbsp;&nbsp;
         <asp:Button ID="Button20" runat="server" Font-Size="X-Large" Height="50px" 
             Text="+" Width="50px" onclick="ButtonPlus" />
&nbsp;&nbsp;
         <asp:Button ID="Button21" runat="server" Font-Size="X-Large" Height="50px" 
             Text="=" Width="50px" onclick="ButtonEqual" />
    </div>
   
        <asp:HiddenField ID="Znk" runat="server" />
        <asp:HiddenField ID="Num1" runat="server" Value="0" />
        <asp:HiddenField ID="Num2" runat="server" Value="0" />
        <asp:HiddenField ID="Rs" runat="server" Value="0" />
        <asp:HiddenField ID="Sb" runat="server" />
        <asp:HiddenField ID="FgC" runat="server" />
        <asp:HiddenField ID="FgZap" runat="server" />
        <asp:HiddenField ID="FgS" runat="server" />
        <asp:HiddenField ID="FgZero" runat="server" />
  
        
   
  
        
        <br />
       
    </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
    

</html>
